package com.qhnu.zxjx.model.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @description: 响应结果
 * @author: panpei
 * @date: 2019/11/13 13:38
 * @version: 1.0
 **/
@ApiModel("结果")
@Data
public class Response<T> {
	@ApiModelProperty("数据")
	private T data;

	@ApiModelProperty("编码")
	private Integer code = 200;

	@ApiModelProperty("提示信息")
	private String message = "";

	public Response() {
	}

	public Response(String message) {
		this.message = message;
	}

	public Response(T data) {
		this.data = data;
	}

	public Response(T data, String message) {
		this.data = data;
		this.message = message;
	}

	public Response(T data, Integer code, String message) {
		this.data = data;
		this.code = code;
		this.message = message;
	}

	public Response(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	@Override
	public String toString() {
		return "Response{" + "data=" + data + ", code=" + code + ", message='" + message + '\'' + '}';
	}
}
